/*
 * @Description: 消息通知
 * @Date: 2023-08-24 15:46:47
 * @FilePath: \hksj-vued:\03code\hk-marketing-crm\src\api\notification\index.ts
 */
import axiosRequest from '/@/utils/request';
/**
 * @method    getUnreadNotices 获取未读的通知信息
 * @method    pageNotice 分页查询通知
 * @method    toRead 标为已读
 */
export function useNotificationApi() {
  return {
    getUnreadNotices: async () => {
      return await axiosRequest({
        url: '/api/notice/getUnreadNotices',
        method: 'POST',
        headers: { noticeFlag: true } // 标识为通知数据查询
      });
    },
    pageNotice: async (params: object) => {
      return await axiosRequest({
        url: '/api/notice/pageNotice',
        method: 'POST',
        data: params,
      });
    },
    toRead: async (params: object) => {
      return await axiosRequest({
        url: '/api/notice/toRead',
        method: 'POST',
        data: params,
      });
    },
  }
}
